function alpha = backtracking(func, x0, f, df, p, c, rho, alpha0)
    alpha = alpha0;
    while (func(x0(1) + alpha * p(1), x0(2) + alpha * p(2)) > f + c * alpha * df' * p)
        alpha = alpha * rho;
    end
end